package org.wdzl.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author
 * 拦截器注册
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    private static String basePath = "E:\\IDEProject\\Exercise\\owner\\im_bird_sys\\images\\qrcode\\";

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // 添加文件下载路径拦截 访问 资源文件
        registry.addResourceHandler("/qrcode/**").addResourceLocations("file:" + basePath);
    }

}
